import torch
import torchvision
import torchaudio

def display_cuda_info():
    print("PyTorch version:", torch.__version__)
    print("Torchvision version:", torchvision.__version__)
    print("Torchaudio version:", torchaudio.__version__)
    print("CUDA available:", torch.cuda.is_available())
    if torch.cuda.is_available():
        print("CUDA version:", torch.version.cuda)
        print("cuDNN version:", torch.backends.cudnn.version())
        print("CUDA architecture list:", torch.cuda.get_arch_list())
    else:
        print("CUDA is not available.")

def check_installation():
    try:
        import subprocess
        subprocess.check_call(['pip', 'check'])
        print("All packages are installed correctly.")
    except subprocess.CalledProcessError as e:
        print(f"An error occurred during package check: {e}")

if __name__ == "__main__":
    display_cuda_info()
    check_installation()
